package android.demo.service.aidl.impl;

import java.util.ArrayList;
import java.util.List;

import android.demo.service.aidl.IContactService;
import android.demo.service.aidl.domain.Contact;
import android.os.RemoteException;

public class ContactServiceImpl extends IContactService.Stub {

	public List<Contact> getContactList(String groupId) throws RemoteException {
		
		ArrayList<Contact> list = new ArrayList<Contact>();
		
		Contact contactA = new Contact();
		contactA.setContactId("contactA");
		contactA.setName("联系人A");
		list.add(contactA);
		
		Contact contactB = new Contact();
		contactB.setContactId("contactB");
		contactB.setName("联系人B");
		list.add(contactB);
		
		return list;
	}

	public Contact[] getContacts(String groupId) throws RemoteException {
		
		Contact[] contacts = new Contact[2];
		
		contacts[0] = new Contact();
		contacts[0].setContactId("contactC");
		contacts[0].setName("联系人C");
		
		contacts[1] = new Contact();
		contacts[1].setContactId("contactD");
		contacts[1].setName("联系人D");
		
		return contacts;
	}

}
